<?php

/**
 * AbetSectionsCourse filter form base class.
 *
 * @package    sfproject
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseAbetSectionsCourseFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'cou_hours'               => new sfWidgetFormPropelChoice(array('model' => 'AbetPlanStudy', 'add_empty' => true, 'key_method' => 'getCouHours')),
      'cou_theory_hours'        => new sfWidgetFormPropelChoice(array('model' => 'AbetPlanStudy', 'add_empty' => true, 'key_method' => 'getCouTheoryHours')),
      'cou_practical_hours'     => new sfWidgetFormPropelChoice(array('model' => 'AbetPlanStudy', 'add_empty' => true, 'key_method' => 'getCouPracticalHours')),
      'asing_theory_sec_num'    => new sfWidgetFormFilterInput(),
      'unasing_theory_sec_num'  => new sfWidgetFormFilterInput(),
      'asing_practical_sec_num' => new sfWidgetFormFilterInput(),
      'sec_theory_times'        => new sfWidgetFormFilterInput(),
      'sec_practical_times'     => new sfWidgetFormFilterInput(),
      'created_at'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'updated_at'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
    ));

    $this->setValidators(array(
      'cou_hours'               => new sfValidatorPropelChoice(array('required' => false, 'model' => 'AbetPlanStudy', 'column' => 'cou_hours')),
      'cou_theory_hours'        => new sfValidatorPropelChoice(array('required' => false, 'model' => 'AbetPlanStudy', 'column' => 'cou_theory_hours')),
      'cou_practical_hours'     => new sfValidatorPropelChoice(array('required' => false, 'model' => 'AbetPlanStudy', 'column' => 'cou_practical_hours')),
      'asing_theory_sec_num'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'unasing_theory_sec_num'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'asing_practical_sec_num' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'sec_theory_times'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'sec_practical_times'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'created_at'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'updated_at'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
    ));

    $this->widgetSchema->setNameFormat('abet_sections_course_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'AbetSectionsCourse';
  }

  public function getFields()
  {
    return array(
      'id'                      => 'Number',
      'cou_num'                 => 'ForeignKey',
      'stu_t'                   => 'Text',
      'cou_hours'               => 'ForeignKey',
      'cou_theory_hours'        => 'ForeignKey',
      'cou_practical_hours'     => 'ForeignKey',
      'asing_theory_sec_num'    => 'Number',
      'unasing_theory_sec_num'  => 'Number',
      'asing_practical_sec_num' => 'Number',
      'sec_theory_times'        => 'Number',
      'sec_practical_times'     => 'Number',
      'created_at'              => 'Date',
      'updated_at'              => 'Date',
    );
  }
}
